import Vue from "vue";
import VueRouter from "vue-router";
let Home = () => import("../views/Home.vue");
let List = () => import("../views/List.vue");
let Cart = () => import("../views/Cart.vue");
let Mine = () => import("../views/Mine.vue");
let Talk = () => import("../views/Talk.vue");
let Reg = () => import("../views/Reg.vue");
let Login = () => import("../views/Login.vue");
let Details = () => import("../views/Details.vue");


Vue.use(VueRouter);

const routes = [
  {
    path: "/home",//路径
    name: "Home",//名称
    component: Home//组件
  },
  {
    path: "/",
    name: "Home",
    redirect: "/home",
  },
  {
    path: "/list",
    name: "List",
    component:List
  },
  {
    path: "/cart",
    name: "Cart",
    component:Cart
  },
  {
    path: "/mine",
    name: "Mine",
    component:Mine
  },
  {
    path: "/talk",
    name: "Talk",
    component:Talk
  },
  {
    path: "/reg",
    name: "Reg",
    component:Reg
  },
  {
    path: "/login",
    name: "Login",
    component:Login
  },
  {
    path: "/details",
    name: "Details",
    component:Details
  }
];

const router = new VueRouter({
  routes
});

export default router;
